<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
  	<meta charset="utf-8">
  	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 	 <title>通知公告</title>
  	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css?v=${FILE_VERSION}" media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css?v=${FILE_VERSION}" media="all">
</head>
<body>
	<div class="layui-fluid">
		<div class="layui-card">
			<div class="layui-card-body">
				<div class="layui-form layer-query">
					<input type="hidden" id="noticeId" value="${noticeId}">
					<input type="hidden" id="orgId" value="${orgId}">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">姓名：</label>
							<div class="layui-input-inline">
								<input type="text" id="userName" autocomplete="off" class="layui-input" maxlength="10">
							</div>
						</div>
						<div class="layui-inline">
							<button class="layui-btn" onclick="reload()">查询</button>
						</div>
					</div>
				</div>
				<hr class="layui-bg-green">
				<table class="layui-table" lay-filter="tableList" id="layerTable">
				</table>
			</div>
		</div>
	</div>

	<script type="text/html" id="dateTpl">
		{{  new Date(d.dateCreate).format("yyyy-MM-dd hh:mm:ss") }}
	</script>

	<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/common/core-2.0.0.js?v=${FILE_VERSION}"></script>
	<script>
		var table;
		layui.use(['table','element','form'], function(){
		  table = layui.table;

		  table.render({ //其它参数在此省略
			  elem : '#layerTable',
			  even :"true",
			  limit: 10,
			  limits: [10,20,30],
			  id: 'tableList',
			  url: getContextPath() + '/sys/orgNotice/userReadDetail/listInfo',
			  page:true,
			  method: 'post', //如果无需自定义HTTP类型，可不加该参数
			  cols:  [[ //标题栏
                  {field:'userName', title:"姓名"}
				  ,{field : 'dateCreate',title : '阅读时间',templet : '<div>{{layui.util.toDateString(d.dateCreate, "yyyy-MM-dd HH:mm:ss")}}</div>'}
			   ]],
			  where :{
				  "orgId" : $("#orgId").val(),
				  "noticeId": $("#noticeId").val()
			  },
			  request: {
				  pageName: 'current', //页码的参数名称，默认：page
				  limitName: 'size' //每页数据量的参数名，默认：limit
			  } //如果无需自定义请求参数，可不加该参数
			});
		});

		function reload(){
			table.reload('tableList', {
                page: {curr: 1}, //重新从第 1 页开始
				where: {
					"userName" : $("#userName").val()
				}
			});
		}
	</script>
</body>
</html>